package com.geek.pokermanager.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.geek.pokermanager.model.PokerStore;
import com.geek.pokermanager.service.PokerStoreService;

import ydh.cicada.dao.JdbcDao;
import ydh.cicada.query.QueryObject;

@Service
@Transactional
public class PokerStoreServiceImpl implements PokerStoreService {

	@Autowired
	private JdbcDao dao;
	
	@Override
	public int addStore(PokerStore store) {
		dao.insert(store);
		return 1;
	}

	@Override
	public List<PokerStore> getStore(String storeId) {
		List<PokerStore> list=QueryObject.select(PokerStore.class)
				.list(dao);
		return list;
	}

	@Override
	public int deleteStore(String storeId) {
		dao.delete(PokerStore.class, storeId);
		return 1;
	}

}
